package stage.tools;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
/**
 * service for the precondition of hibernate.
 * @author remi liu(Liu Zhibin)
 * @version 0.0
 */
public class HibernateUtil {
	public static final SessionFactory sf;
	static
	{
		try
		{
			Configuration configuration = new Configuration().configure();
			sf = configuration.buildSessionFactory();
		}
		catch (Throwable ex)
		{
			System.err.println("初始化SessionFactory出现异常." + ex);
			throw new ExceptionInInitializerError(ex);
		}
	}
}
